<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<ui:composition template="/WEB-INF/templates/headerFooter.xhtml">
	<ui:define name="content">
		<style type="text/css">
.ui-datatable-header {
	padding: 0px !important;
}
</style>
		<h:form>
			<p:panel header="Filter" collapsed="false" toggleable="true">
				All filters should be placed here
				<br />
				<p:commandButton actionListener="#{assetsController.findAssets}"
					update="assetsTable" value="Find"></p:commandButton>
			</p:panel>
			<p:panel header="View" collapsed="true" toggleable="true">
				All view settings should be placed here
				 <p:selectManyCheckbox layout="pageDirection">
					<f:selectItem itemLabel="UMDNS Code" itemValue="Option 1" />
					<f:selectItem itemLabel="Generic Name" itemValue="Option 2" />
					<f:selectItem itemLabel="Full Name" itemValue="Option 3" />
					<f:selectItem itemLabel="Manufacturer" itemValue="Option 3" />
					<f:selectItem itemLabel="Building" itemValue="Option 3" />
				</p:selectManyCheckbox>
				<p:commandButton value="Show"></p:commandButton>
			</p:panel>
			<br />
			<br />
			<p:dataTable resizableColumns="false" id="assetsTable"
				value="#{assetsController.assetsTable.assetsList}" var="row"
				emptyMessage="No Assets were found" paginator="true"
				paginatorPosition="bottom"
				paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rows="20" rowsPerPageTemplate="20, 50, 100, 200, 500" pageLinks="5">
				<f:facet name="header">
					<h:panelGrid columns="10" style="text-align: left; display: block">
						<p:commandButton value="New" action="assets-create" ajax="false"
							immediate="true"></p:commandButton>
						<p:menuButton value="Edit">
							<p:menuitem value="Edit property"></p:menuitem>
							<p:menuitem value="Delete"></p:menuitem>
						</p:menuButton>
						<p:menuButton value="Export">
							<p:menuitem value="Export page to PDF"></p:menuitem>
							<p:menuitem value="Export page to XLS"></p:menuitem>
							<p:menuitem value="Export all to PDF">
							</p:menuitem>
							<p:menuitem value="Export all to XLS"></p:menuitem>
						</p:menuButton>
					</h:panelGrid>
				</f:facet>

				<p:column style="width:16px">
					<p:rowToggler />
				</p:column>

				<p:column headerText="UMDNS Code">
					<h:outputText value="#{row.umdnsCode}" />
				</p:column>

				<p:column headerText="Generic Name">
					<h:outputText value="#{row.genericName}" />
				</p:column>

				<p:column headerText="Full name">
					<h:outputText value="#{row.fullName}" />
				</p:column>

				<p:column headerText="Manufacturer">
					<h:outputText value="#{row.manufacturer}" />
				</p:column>

				<p:column headerText="Building">
					<h:outputText value="#{row.locationBuilding}" />
				</p:column>

				<p:rowExpansion>
					<h:panelGrid id="display" columns="2" cellpadding="4"
						style="width:300px;" styleClass="ui-widget-content"
						columnClasses="label, value">
						<h:panelGrid columns="1" style="border:none !important;">
							<p:graphicImage value="/resources/img/assets/asset1.jpg"
								width="100" height="100" />
							<h:panelGroup>
								<h:outputText
									value="Any additional information can be placed here:" />
								<h:panelGrid columns="2" style="margin-left: 5px; border: none !important" >
									<h:outputText value="UMDNS:" />
									<h:outputText value="#{row.umdnsCode}" />
									<h:outputText value="Generic Name:" />
									<h:outputText value="#{row.genericName}" />
									<h:outputText value="Full Name:" />
									<h:outputText value="#{row.fullName}" />
									<h:outputText value="Manufacturer:" />
									<h:outputText value="#{row.manufacturer}" />
								</h:panelGrid>
							</h:panelGroup>
						</h:panelGrid>

					</h:panelGrid>

				</p:rowExpansion>
			</p:dataTable>
		</h:form>
	</ui:define>

</ui:composition>
</html>